package P5.T05;

import javax.swing.*;
import java.awt.*;
import java.net.MalformedURLException;
import java.net.URL;

public class MyJFrame3 extends JFrame {
    public MyJFrame3() throws MalformedURLException {
        setTitle("MyJFrame3");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 450, 300);
        ImageIcon icon=new ImageIcon(new URL("https://img.zcool.cn/community/01eb875b9a7fdea8012099c82631e0.png@1280w_1l_2o_100sh.png"));
        Image img=icon.getImage().getScaledInstance(360,290,Image.SCALE_FAST);
        icon=new ImageIcon(img);
        JLabel lbl=new JLabel("猪八戒",icon,JLabel.LEFT);
        add(lbl);
        setVisible(true);
    }
}
